<%@page import="website.modelo.JuegoBean"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">
<head>
<title>TB_Parcial</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="css/bootstrap-3.2.0.css" rel="stylesheet">
<link href="css/bootstrap-theme-3.2.0.css" rel="stylesheet">
<link href="css/offcanvas.css" rel="stylesheet">
<script src="js/jquery-1.10.2.js"></script>
<script src="js/bootstrap-3.2.0.js"></script>
<script type="text/javascript">
	function isNumber(evt) {
	   evt = (evt) ? evt : window.event;
	   var charCode = (evt.which) ? evt.which : evt.keyCode;
	   if (charCode > 31 && (charCode < 48 || charCode > 57)) {
	       return false;
	   }
	   return true;
	}
</script>
</head>
<body>
	<jsp:include page="menuAdmin.jsp"/>

	<div class="container">
		<div class="span4">
			<div class="margin-div">
				<form method="post" action="GrabarJuegoServlet" class="well form-horizontal"
					enctype="multipart/form-data">
					<% JuegoBean juego = (JuegoBean) request.getAttribute("juego"); %>
					
					<fieldset>

						<legend>Editar Juego</legend>

						<div class="control-group ">
							<label for="nombre" class="control-label">Nombre</label>
							<div class="controls">
								<input type="text" name="nombre" value="<%=juego.getNombre()%>" required="required"/>
							</div>
						</div>

						<div class="control-group ">
							<label for="descripcion" class="control-label">Descripcion</label>
							<div class="controls">
								<textarea name="descripcion" rows="3" class="span8" required="required"><%=juego.getDescripcion()%></textarea>
							</div>
						</div>

						<div class="control-group">
							<label for="materiales" class="control-label">Materiales</label>
							<div class="controls">
								<input type="text" name="materiales" value="<%=juego.getMateriales()%>" required="required"/>
							</div>
						</div>

						<div class="control-group">
							<label for="costo" class="control-label">Costo</label>
							<div class="controls">
								<input type="text" name="costo" value="<%=juego.getCostoPersona()%>" onkeypress="return isNumber(event)"  required="required"/>
							</div>
						</div>

						<div class="control-group ">
							<label for="imagen" class="control-label">Imagen</label>
							<div class="controls">
								<input name="imagenDefault" type="hidden" value="<%=juego.getImagen()%>">
								<img width="80" height="60" style="margin-bottom: 10px" src="<%=request.getContextPath() + juego.getImagen()%>">
								<input type="file" name="imagen" />
							</div>
						</div>
					</fieldset>

					<div class="form-actions">
						<input id="btnAccion" type="submit" class="btn btn-primary" value="Grabar" />
						<a onclick="javascript:irMantenimientoJuego()" href="#" class="btn active" role="button">Cancelar</a>
					</div>
					<input type="text" name="juegoId" value="<%=juego.getId() %>" style="display: none;"/>
				</form>
			</div>
		</div>
	</div>


</body>
</html>
